package com.hut.oa.model.dao.discuss;


import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.hut.oa.model.bean.DiscussArea;
import com.hut.oa.model.bean.DiscussVote;

public interface DiscussVoteDao extends PagingAndSortingRepository<DiscussVote, Long>{
	//投票帖子
	@Query("from DiscussVote dv")
	Page<DiscussVote> voteDiscussList(Pageable pageable);
	
	//根据帖子查出投票贴
	@Query("from DiscussVote da where da.discuss=:discuss")
	DiscussVote voteOne(@Param("discuss") DiscussArea discuss);
}
